package 集合;

// 面试问题
public class TestDemo2 {
    public static void main(String[] args) {
        Integer a = 100;
        Integer b = 100;
        System.out.println(a == b);// true

        Integer a1 = 200;
        Integer b1 = 200;
        System.out.println(a1 == b1);// false


        /*
        * [-128 127]的元素会被存到数组cache中,用的时候直接拿即可
        * 如果不在此范围,则会new Integer(i);
        * */

    }

/*

   public static Integer valueOf(int i) {
        return i >= -128 && i <= Integer.IntegerCache.high ? Integer.IntegerCache.cache[i + 128] : new Integer(i);
    }

*/
}
